import socket

sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
sock.connect(('esp32_ip', 8080))
sock.sendall(b'capture')  # 发送“拍照”指令